/**
 * @author Stodger
 */

function countUp(count) {
	var div_by = 100,
    speed = Math.round(count / div_by),
    $display = $('.count'),
    run_count = 1,
    int_speed = 24;
	console.log(speed + '============speed1');
	var int = setInterval(function() {
    if(run_count < div_by){
        $display.text(speed * run_count);
        run_count++;
    } else if(parseInt($display.text()) < count) {
        var curr_count = parseInt($display.text()) + 1;
        $display.text(curr_count);
    } else {
        clearInterval(int);
    }
	}, int_speed);
}
function countUp2(count)
{
    var div_by = 54,
        speed = Math.round(count / div_by),
        $display = $('.count2'),
        run_count = 1,
        int_speed = 24;
    var int = setInterval(function() {
    	if(run_count < div_by){
            $display.text(speed * run_count);
            run_count++;
        } else if(parseInt($display.text()) < count) {
            var curr_count = parseInt($display.text()) + 1;
            $display.text(curr_count);
        } else {
            clearInterval(int);
        }
    }, int_speed);
}

/* countUp2(947); */

function countUp3(count)
{
    var div_by = 100,
        speed = Math.round(count / div_by),
        $display = $('.count3'),
        run_count = 1,
        int_speed = 24;
    var int = setInterval(function() {
        if(run_count < div_by){
            $display.text(speed * run_count);
            run_count++;
        } else if(parseInt($display.text()) < count) {
            var curr_count = parseInt($display.text()) + 1;
            $display.text(curr_count);
        } else {
            clearInterval(int);
        }
    }, int_speed);
}